package com.bdqn.shiro.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bdqn.shiro.config.mybatis.ServiceImpl;
import com.bdqn.shiro.pojo.SalChance;
import com.bdqn.shiro.service.SalChanceService;
import com.bdqn.shiro.mapper.SalChanceMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 *
 */
@Service
public class SalChanceServiceImpl extends ServiceImpl<SalChanceMapper, SalChance>
    implements SalChanceService{

    @Resource
    private SalChanceMapper salChanceMapper;

    @Override
    public List<SalChance> getList(Page<SalChance> page, SalChance salChance) {
        return salChanceMapper.getList(page,salChance);
    }

    @Override
    public boolean saveSalChance(SalChance salChance) {
        Integer chcId=Integer.valueOf(salChance.getChcId().toString());
        if (chcId>0 && chcId!=null){
            salChanceMapper.updateById(salChance);
        }else{
            salChanceMapper.insert(salChance);
        }

        return true;
    }
}




